/**
 * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.babble.subitem.service;

import com.babble.subitem.dto.TagSaveDTO;
import com.babble.subitem.dto.TagUpdDTO;
import com.babble.subitem.entity.Tag;
import com.babble.subitem.vo.TagVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.common.exception.MsgException;

import java.util.List;

/**
 * 标签表 服务类
 *
 * @author Blade
 * @since 2021-11-21
 */
public interface ITagService extends IService<Tag> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param tag
	 * @return
	 */
	IPage<TagVO> selectTagPage(IPage<TagVO> page, TagVO tag);

	/**
	 * 获取首页展示的标签
	 * 先从reids获取,如果等于null,就从数据库拿
	 * @return
	 */
	List<Tag> selectTags();

	/**
	 * 用户点击指定的标签,标签数增加
	 * @param id
	 */
	void clickTag(String id) throws MsgException;

	/**
	 * 通过ID获取标签信息
	 * @param id
	 * @return
	 */
	List<Tag> info(String id) throws MsgException;

	/**
	 * 添加标签
	 * @param tag
	 */
	void saveToTag(TagSaveDTO tag) throws MsgException;

	/**
	 * 删除标签
	 * @param id
	 */
	void delToTag(String id);

	/**
	 * 修改标签
	 * @param tag
	 */
	void updToTag(TagUpdDTO tag);
}
